Update particle builtins description in Spatial shader#11879
Conversation
I would argue in the particle shader page as a separate section with a barebone example on how to read/write the values. |
ef795b6 to
9ba6fb1
Compare
| * **x**: Current rotation angle in radians. | ||
| * **y**: Time the particle has been active in seconds. | ||
| * **z**: Current animation frame. | ||
| * **w**: Particle lifetime in seconds. |
There was a problem hiding this comment.
This is incorrect. I don't know how to easily phrase it, but it contains the randomness of the lifetime.
So for example a certain particle may have 0.9 in CUSTOM.w, meaning the particle lives for 90% of the specified lifetime. So when this particle dies, CUSTOM.y will contain 0.9. Dividing Y by W gives the correct result.
I count on you all to figure out a phrasing for this, i have no idea how to make it intuitive.
There was a problem hiding this comment.
I've amended the description based on this, but I haven't tested it in-engine.
Is there a way to access the total particle lifetime in seconds? As I understand it, having access to the lifetime randomness ratio alone doesn't make it possible to figure out the total lifetime in seconds, and therefore calculate a phase from 0.0 to 1.0.
For example, with a lifetime randomness of 0.6, CUSTOM.W would be between 0.4 and 1.0 (randomly determined for each particle).
There was a problem hiding this comment.
I think this is a question worth answering. Marking as unsolved to make it noticeable.
|
@Calinou Poke. Please see QbieShay's review |
|
Another gentle @Calinou bump :) |
f6a1755 to
20b9689
Compare
20b9689 to
7461c74
Compare
Mickeon
left a comment
There was a problem hiding this comment.
It's not that big of a deal, but I would personally document w by itself, along with the division, because otherwise we're giving a rather vague, albeit useful instruction based on assumptions. Who knows, they could be needing that value for something else.
| * **z**: Animation frame. | ||
| * **x**: Current rotation angle in radians. | ||
| * **z**: Current animation frame. | ||
| * **y / w** (division): Lifetime fraction from 0.0 to 1.0. |
There was a problem hiding this comment.
Mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm.
| * **y / w** (division): Lifetime fraction from 0.0 to 1.0. | |
| * **y / w** (division): Lifetime fraction from ``0.0`` to ``1.0``. |
| * **x**: Current rotation angle in radians. | ||
| * **y**: Time the particle has been active in seconds. | ||
| * **z**: Current animation frame. | ||
| * **w**: Particle lifetime in seconds. |
There was a problem hiding this comment.
I think this is a question worth answering. Marking as unsolved to make it noticeable.
If we want to merge this now, I can remove the
USERDATA1note and split it to its own PR.PS:
USERDATA1-6aren't documented anywhere in the manual. What would be the best place to introduce it? These are only available in particle shaders.